/*
 * @Author: your name
 * @Date: 2020-09-22 17:23:28
 * @LastEditTime: 2021-02-01 15:38:04
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \longh_admin\src\router\index.js
 */
import Vue from 'vue'
import Router from 'vue-router'
import { constantRouterMap,asyncRouterMap } from '@/config/router.config'

// hack router push callback
const originalPush = Router.prototype.push
Router.prototype.push = function push (location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

export default new Router({
  mode: 'history',
  // 注释异步
  base: '/aupply-chains-14-16200/',
  routes: constantRouterMap.concat(asyncRouterMap)
  // routes: constantRouterMap
})
